(python-shift-left, python-shift-right):
authorMartin Rudalics <rudalics@gmx.at>
Fri, 20 Feb 2009 16:30:53 +0000 (16:30 +0000)
committerMartin Rudalics <rudalics@gmx.at>
Fri, 20 Feb 2009 16:30:53 +0000 (16:30 +0000)
When the mark is not active shift the current line.  (Bug#2381)

lisp/ChangeLog
lisp/progmodes/python.el

index 9ba81c5abcc2ff17ac02a0113a6f013a80b41fba..23b3d8401070479cad42d6bd09a7ef47c1318905 100644 (file)
@@ -1,3 +1,9 @@
+2009-02-20  Martin Rudalics  <rudalics@gmx.at>
+
+       * progmodes/python.el (python-shift-left, python-shift-right):
+       When the mark is not active shift the current line.  (Bug#2381)
+       Suggested by Guillaume Salagnac <guillaume.salagnac@gmail.com>
+
 2009-02-20  Andreas Schwab  <schwab@suse.de>
 
        * startup.el (command-line): Don't match an empty argument as an
index cacd56b6639e64104fa04d4c69a15f20da3409ed..7221d8ecb73ace577de324ca80d69f3b39913b70 100644 (file)
@@ -2008,9 +2008,10 @@ COUNT defaults to `python-indent'.  If region isn't active, just shift
 current line.  The region shifted includes the lines in which START and
 END lie.  It is an error if any lines in the region are indented less than
 COUNT columns."
-  (interactive (if mark-active
-                  (list (region-beginning) (region-end) current-prefix-arg)
-                (list (point) (point) current-prefix-arg)))
+  (interactive
+   (if mark-active
+       (list (region-beginning) (region-end) current-prefix-arg)
+     (list (line-beginning-position) (line-end-position) current-prefix-arg)))
   (if count
       (setq count (prefix-numeric-value count))
     (setq count python-indent))
@@ -2031,9 +2032,10 @@ COUNT columns."
 COUNT defaults to `python-indent'.  If region isn't active, just shift
 current line.  The region shifted includes the lines in which START and
 END lie."
-  (interactive (if mark-active
-                  (list (region-beginning) (region-end) current-prefix-arg)
-                (list (point) (point) current-prefix-arg)))
+  (interactive
+   (if mark-active
+       (list (region-beginning) (region-end) current-prefix-arg)
+     (list (line-beginning-position) (line-end-position) current-prefix-arg)))
   (if count
       (setq count (prefix-numeric-value count))
     (setq count python-indent))